﻿// -----------------------------------------------------------------------
// <copyright file="AsyncCompleteEventArgs.cs" company="TaskyMedia LLC">
// Copyright (c) TaskyMedia LLC
// </copyright>
// -----------------------------------------------------------------------

namespace SohpClient
{
    using System;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public class AsyncCompleteEventArgs : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="AsyncCompleteEventArgs"/> class.
        /// </summary>
        /// <param name="asyncState">The asynchronous state object.</param>
        /// <param name="isSuccess">If set to <c>true</c> the operation was successful.</param>
        public AsyncCompleteEventArgs(object asyncState, bool isSuccess)
            : this(asyncState, isSuccess, null)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="AsyncCompleteEventArgs"/> class.
        /// </summary>
        /// <param name="asyncState">The asynchronous state object.</param>
        /// <param name="isSuccess">If set to <c>true</c> the operation was successful.</param>
        /// <param name="exception">The exception that occured during processing.</param>
        public AsyncCompleteEventArgs(object asyncState, bool isSuccess, Exception exception)
        {
            this.AsyncState = asyncState;
            this.IsSuccess = isSuccess;
            this.Exception = exception;
        }

        /// <summary>
        /// Gets the asynchronous state object.
        /// </summary>
        /// <value>
        /// The asynchronous state object.
        /// </value>
        public object AsyncState
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets a value indicating whether the action completed successfully.
        /// </summary>
        /// <value>
        /// <c>true</c> if the action completed successfully; otherwise, <c>false</c>.
        /// </value>
        public bool IsSuccess
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets the exception that occured during processing.
        /// </summary>
        public Exception Exception
        {
            get;
            private set;
        }
    }
}